package edu.zut.cs.network.Experiment2;

import javax.swing.JOptionPane;

public class Letter {
    public static void main(String[] args) {
        String le = JOptionPane.showInputDialog("请输入你想要转换的字母：");
        char[] cs = le.toCharArray();
        int num = (int) cs[0];
        int num1 = num ^ 32;
        char letter = (char) num1;
//        System.out.println(letter);

        if (num1 > 64 && num1 < 91) {
            JOptionPane.showMessageDialog(null,
                    "该字母转换为大写字母：" + letter,
                    "转换结果", JOptionPane.INFORMATION_MESSAGE);
        } else {
            JOptionPane.showMessageDialog(null,
                    "该字母转换为小写字母：" + letter, "转换结果",
                    JOptionPane.INFORMATION_MESSAGE);
        }
    }
}



